package com.hangjiang.gulidear.model;

import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 * Changeaudit entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "changeaudit", catalog = "sqm")
public class ChangeAudit extends BaseEntity {

	// Fields

	private String auditorId;
	private User user;
	private ConfigChange configchange;
	private Integer auditor;
	private String auditOpinion;
	private Timestamp auditTime;

	// Constructors

	/** default constructor */
	public ChangeAudit() {
	}

	/** full constructor */
	public ChangeAudit(User user, ConfigChange configchange, Integer auditor,
			String auditOpinion, Timestamp auditTime) {
		this.user = user;
		this.configchange = configchange;
		this.auditor = auditor;
		this.auditOpinion = auditOpinion;
		this.auditTime = auditTime;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "auditorId", unique = true, nullable = false, length = 32)
	public String getAuditorId() {
		return this.auditorId;
	}

	public void setAuditorId(String auditorId) {
		this.auditorId = auditorId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "userId")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "changeId")
	public ConfigChange getConfigchange() {
		return this.configchange;
	}

	public void setConfigchange(ConfigChange configchange) {
		this.configchange = configchange;
	}

	@Column(name = "auditor")
	public Integer getAuditor() {
		return this.auditor;
	}

	public void setAuditor(Integer auditor) {
		this.auditor = auditor;
	}

	@Column(name = "auditOpinion", length = 32)
	public String getAuditOpinion() {
		return this.auditOpinion;
	}

	public void setAuditOpinion(String auditOpinion) {
		this.auditOpinion = auditOpinion;
	}

	@Column(name = "auditTime", length = 0)
	public Timestamp getAuditTime() {
		return this.auditTime;
	}

	public void setAuditTime(Timestamp auditTime) {
		this.auditTime = auditTime;
	}

}